package com.wz.project.cxtj.viewstockstatistic.service.impl;

import com.wz.common.utils.text.Convert;

import com.wz.project.cxtj.viewstockstatistic.mapper.ViewStockStatisticsMapper;
import com.wz.project.cxtj.viewstockstatistic.service.IViewStockStatisticsService;
import com.wz.project.cxtj.viewstockstatistic.domain.ViewStockStatistics;
import com.wz.project.stock.domain.BasStock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 库存统计Service业务层处理
 *
 * @author wz
 * @date 2022-05-18
 */
@Service
public class ViewStockStatisticsServiceImpl implements IViewStockStatisticsService {

    @Autowired
    private ViewStockStatisticsMapper viewStockStatisticsMapper;

    /**
     * 查询库存统计
     *
     * @param warehouseCode 库存统计ID
     * @return 库存统计
     */
    @Override
    public ViewStockStatistics selectViewStockStatisticsById(String warehouseCode) {
        return viewStockStatisticsMapper.selectViewStockStatisticsById(warehouseCode);
    }

    @Override
    public List<ViewStockStatistics> selectStockCountList(ViewStockStatistics viewStockStatistics) {
        return viewStockStatisticsMapper.selectStockCountList(viewStockStatistics);
    }

    /**
     * 查询库存统计列表
     *
     * @param viewStockStatistics 库存统计
     * @return 库存统计
     */
    @Override
    public List<ViewStockStatistics> selectViewStockStatisticsList(ViewStockStatistics viewStockStatistics) {
        return viewStockStatisticsMapper.selectViewStockStatisticsList(viewStockStatistics);
    }

    /**
     * 新增库存统计
     *
     * @param viewStockStatistics 库存统计
     * @return 结果
     */
    @Override
    public int insertViewStockStatistics(ViewStockStatistics viewStockStatistics) {
        return viewStockStatisticsMapper.insertViewStockStatistics(viewStockStatistics);
    }

    /**
     * 修改库存统计
     *
     * @param viewStockStatistics 库存统计
     * @return 结果
     */
    @Override
    public int updateViewStockStatistics(ViewStockStatistics viewStockStatistics) {
        return viewStockStatisticsMapper.updateViewStockStatistics(viewStockStatistics);
    }

    /**
     * 删除库存统计对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteViewStockStatisticsByIds(String ids) {
        return viewStockStatisticsMapper.deleteViewStockStatisticsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除库存统计信息
     *
     * @param warehouseCode 库存统计ID
     * @return 结果
     */
    @Override
    public int deleteViewStockStatisticsById(String warehouseCode) {
        return viewStockStatisticsMapper.deleteViewStockStatisticsById(warehouseCode);
    }

    @Override
    public List<BasStock> selectStockList(BasStock basStock) {
        return viewStockStatisticsMapper.selectStockList(basStock);
    }
}
